import request from '@/config/axios'

export interface MessageInfoVO {
  id: number
  type: number
  content: string
  fileCount: number
  fileUrl: string
  schoolId: number
  collegeId: number
  classesId: number
  deptId: number
  originModule: string
  userType: number
}

// 查询留言建议分页
export const getMessageInfoPage = async (data) => {
  return await request.post({ url: `/system/message-info/page`, data })
}
// 查询留言建议列表
export const getMessageInfoList = async (data) => {
  return await request.post({ url: `/system/message-info/query`, data })
}

// 查询留言建议详情
export const getMessageInfo = async (id: number) => {
  return await request.get({ url: `/system/message-info/get?id=` + id })
}

// 新增留言建议
export const createMessageInfo = async (data: MessageInfoVO) => {
  return await request.post({ url: `/system/message-info/create`, data })
}

// 修改留言建议
export const updateMessageInfo = async (data: MessageInfoVO) => {
  return await request.put({ url: `/system/message-info/update`, data })
}

// 删除留言建议
export const deleteMessageInfo = async (id: number) => {
  return await request.delete({ url: `/system/message-info/delete?id=` + id })
}

// 导出留言建议 Excel
export const exportMessageInfo = async (params) => {
  return await request.download({ url: `/system/message-info/export-excel`, params })
}

// 下载留言建议 Excel模版
export const importTemplate = async () => {
  return await request.download({ url: `/system/message-info/get-import-template` })
}

// 导入留言建议 Excel
export const importMessageInfo = async (data) => {
  return await request.upload({ url: `/system/message-info/import-excel`, data: data })
}

// 获取模块精简信息列表
export const getListAllSimple = async (data) => {
  return await request.get({ url: `/system/module/list-all-simple`, data: data })
}
